package model

type Room struct {
	Id         int64  `gorm:"primaryKey;column:id"json:"id" `
	SchoolId   int64  `gorm:"column:school_id;default:0"json:"school_id"`
	JzwId      int64  `gorm:"column:jzw_id;default:0"json:"jzw_id"`
	FloorId    int64  `gorm:"column:floor_id;default:0"json:"floor_id"`
	RoomName   string `gorm:"column:room_name;default:''" json:"room_name"`
	RoomNumber string `gorm:"column:room_number;default:''" json:"room_number"`
	SeatTotal  int    `gorm:"column:seat_total;default:0" json:"seat_total"`
	CreateTime int64  `gorm:"column:create_time;default:0" json:"create_time" `
}

func (Room) TableName() string {
	return "fd_room"
}

type RoomToJzwFloor struct {
	Id         int64     `json:"id" `
	SchoolId   int64     `json:"school_id"`
	JzwId      int64     `json:"jzw_id"`
	FloorId    int64     `json:"floor_id"`
	RoomName   string    `json:"room_name"`
	RoomNumber string    `json:"room_number"`
	CreateTime int64     `json:"create_time" `
	Jzw        JoinJzw   `json:"jzw" gorm:"foreignKey:id;references:jzw_id"`
	Floor      JoinFloor `json:"floor" gorm:"foreignKey:id;references:floor_id"`
}

func (RoomToJzwFloor) TableName() string {
	return "fd_room"
}

type JoinRoom struct {
	Id         int64  `gorm:"primaryKey;column:id"json:"id" `
	RoomName   string `gorm:"column:room_name;default:''" json:"room_name"`
	RoomNumber string `gorm:"column:room_number;default:''" json:"room_number"`
	SeatTotal  int    `gorm:"column:seat_total;default:0" json:"seat_total"`
}

func (JoinRoom) TableName() string {
	return "fd_room"
}

type RoomDetail struct {
	Id         int64  `gorm:"primaryKey;column:id"json:"id" `
	JzwId      int64  `gorm:"column:jzw_id;default:0"json:"jzw_id"`
	RoomName   string `gorm:"column:room_name;default:''" json:"room_name"`
	RoomNumber string `gorm:"column:room_number;default:''" json:"room_number"`
	SeatTotal  int    `gorm:"column:seat_total;default:0" json:"seat_total"`
}

func (RoomDetail) TableName() string {
	return "fd_room"
}

type RoomList struct {
	Id              int64             `gorm:"primaryKey;column:id"json:"id" `
	JzwId           int64             `gorm:"column:jzw_id;default:0"json:"jzw_id"`
	RoomName        string            `gorm:"column:room_name;default:''" json:"room_name"`
	RoomNumber      string            `gorm:"column:room_number;default:''" json:"room_number"`
	SeatTotal       int               `gorm:"column:seat_total;default:0" json:"seat_total"`
	ExamStudentList []JoinStudentExam `json:"examStudentList"  gorm:"foreignKey:room_id;references:id"`
}

func (RoomList) TableName() string {
	return "fd_room"
}
